package sk.hackcraft.util.generator.empirical;

import sk.hackcraft.util.generator.DiscreteConstantRandom;

public class ConstantBuilderItem extends AbstractBuilderItem
{
	private final int value;
	
	public ConstantBuilderItem(double probability, int value)
	{
		super(probability);
		this.value = value;
	}
	
	@Override
	public EmpiricalItemCreatorDelegate getEmpiricalItemCreatorDelegate()
	{
		return new EmpiricalItemCreatorDelegate()
		{
			@Override
			public EmpiricalItem createEmpiricalItem(double cumulativeValue)
			{
				return new EmpiricalItem(cumulativeValue, new DiscreteConstantRandom(value));
			}
		};
	}
}
